package org.springblade.modules.repair.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.repair.entity.MaintainPlanContentUser;
import org.springblade.modules.repair.enums.EmerProcTypeEnum;
import org.springblade.modules.repair.enums.WorkOrderTypeEnum;

import java.util.Date;
import java.util.List;

/**
 * @Date 9:36 2021/10/18
 * @Description {
 *    维修详情
 * }
 * @Author lsay
 **/
@Data
public class MalFunctionApproveDetailVO {

	/**
	 * 任务 id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long planId;

	/**
	 * 任务状态
	 */
	private Integer status;

	/**
	 * 审批状态：1-待审批，2-通过，3-驳回, 4-撤回
	 */
	private Integer approveStatus;

	/**
	 * 电梯id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long elevatorId;

	/**
	 * 电梯状态： 1-正常,2-停梯
	 */
	private Integer elevatorStop;

	/**
	 * 故障信息
	 */
	private List<FaultMessageVO> faultMessageList;

	/**
	 * 报障信息
	 */
	private FaultReportVO faultReportVO;

	/**
	 * 处理反馈结果
	 */
	private FaultFeedbackVO faultFeedbackVO;

	/**
	 * 关联任务的用户
	 */
	private List<MaintainPlanContentUser> planContentUsers;

	/**
	 * 紧急程度
	 */
	private Integer emerProcType;

	/**
	 * 工单类型
	 */
	private Integer workOrderType;

	/**
	 * 紧急程度描述
	 */
	private String emerProcTypeName;

	/**
	 * 工单类型描述
	 */
	private String workOrderTypeName;

	/**
	 * 2024-04-28 新增 计划时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date planDate;

	/**
	 * 2024-04-28 新增预计完成时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd")
	private Date planFinishDate;

	/**
	 * 2024-04-28 新增来源类型
	 */
	private Integer sourcePlanType;

	/**
	 * 2024-24-28 新增来源类型名
	 */
	private String sourcePlanTypeName;

	/**
	 * 2024-04-29 新增关联工单id列表
	 */
	private List<Long> relatedWorkOrderIds;

	/**
	 * 2024-04-29 新增是否允许修改来源类型
	 */
	private Boolean isAllowModify;

	public void setEmerProcType(Integer emerProcType) {
		if(Func.isNotEmpty(emerProcType)){
			this.emerProcTypeName = EmerProcTypeEnum.getName(emerProcType);
		}
		this.emerProcType = emerProcType;
	}

	public void setWorkOrderType(Integer workOrderType) {
		if(Func.isNotEmpty(workOrderType)){
			this.workOrderTypeName = WorkOrderTypeEnum.getName(workOrderType);
		}
		this.workOrderType = workOrderType;
	}

}




























